﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Security;
using Final.App_Code;

namespace Final
{
    public partial class Login1 : System.Web.UI.Page
    {
        protected void Button1_Click(object sender, EventArgs e)
        {
            Student a = new Student();
            bool check = a.Login(Usertxt.Text, Passtxt.Text);
            
            if (check == true)
            {
                Session["id"] = Usertxt.Text;
                Session["password"] = Passtxt.Text;
                FormsAuthentication.RedirectFromLoginPage(Usertxt.Text, false);
            }
            else
            {
                lblError.Text = "Incorrect User ID & Password. Please try again.";
            }
        }

        protected void Button2_Click(object sender, EventArgs e)
        {

        }
     }
}   

